﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
using PodcastGenerator;

namespace PodcastTestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var sermonDownloader = new SermonDownloader(Path.GetFullPath("MP3 Store"));
            var sermonBuilder = new SermonBuilder();
            var scraper = new Scraper(sermonBuilder);

            var web = new HtmlWeb();
            var sourcePage = web.Load("http://www.waterkloofbaptist.org.za/index.php?page=sermons");
            
            var sermons = scraper.Scrape(sourcePage).ToList();
            var store = new CsvStore(sermonDownloader, Path.GetFullPath("CsvStore"));
            store.PersistAll(sermons);
        }
    }
}
